<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>验证码大厅</title>
    <link rel="shortcut icon" href="../rent.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../public/libs/vant.css">
    <link rel="stylesheet" href="../public/css/register.css">
    <!-- <link rel="stylesheet" href="../public/libs/setting.css"> -->
    <link rel="stylesheet" href="../public/libs/app.css">
</head>
<style>
    * {
        font-size: 16px;
    }

    .gm {
        font-size: 14px;
        color: #ffffff;
        margin-left: 18%;
    }

    a {
        color: #ffffff;
    }

    .iconContainer {
        margin-top: 10px;
        margin-bottom: 40px;
    }

    .k {
        width: 200px;
        height: 34px;
        margin: 0 auto;
        text-align: left;
        margin-top: 10px;


    }

    .text {
        border: none;
        border-radius: 1px;
        width: 215px;
        height: 200pxpx;
        margin: 0 auto;
        text-align: left;
        margin-top: 10px;
    }
</style>

<body>
    <header>
        <a href="login.html">
            <img src="../public/img/fanhuiWhite.png" alt="">
        </a>
    </header>
    <section class="registerContainer">
        <div class="iconContainer">
            <p>验证码大厅</p>
        </div>
        <div id="app">
            <ul class="inputBox">
                <li>
                    <span>剩余{{second}}秒后退出登录页面</span>
                </li>
                <li>
                    <span>{{AccountType}}账号</span>
                    <span>{{num}}</span>
                </li>
                <li>
                    <span>密码</span>
                    <span>{{pwd}}</span>
                </li>
                <li>
                    <span>到期时间</span>
                    <!-- <p>{{time}}</p> -->
                    <button class="yanzhengma" @click='xf'>续费</button>
                </li>
                <li>
                    <!-- <span>到期时间</span> -->
                    <p style="font-size=12px">{{time}}</p>
                    <!-- <button class="yanzhengma" @click='xf'>续费</button> -->
                </li>
                <li>
                    <span>验证码框</span>
                    <button class="yanzhengma" @click='huoqu_yzm()'>点我获取验证码</button>
                </li>
                <!-- <li>
                    <span>验证码</span>
                    <span>{{yzm}}</span>
                </li> -->
                <!-- <li>
                    <input class="yzmInput" type="text" placeholder="" v-model="yz_code" readonly="true">
                    <button class="yanzhengma" v-cloak @click="getCheckCode"
                        v-bind:disabled="disabled">{{ countDown }}</button>
                </li> -->
                <!-- <li>
                    <span>选择续费天数</span>
                    <select id="citySel" class="select" @change="change_price(value)" v-model="value">
                        <option :value="index" v-for="(item,index) in list">{{item.numberDays}}</option>

                    </select>
                </li>
                <li>
                    <span>价格</span>
                    <span>{{price}}</span>
                </li>
                <li>
                    <span>当前邀请码</span>
                    <span>{{yqm}}</span>
                </li> -->

            </ul>
            <!-- <div>
                <p class="k">验证码框</p>
                <button class="yanzhengma" @click='xf'>续费</button>
            </div> -->

            <textarea name="" class="text" id="" cols="20" rows="10" v-html="yzm_string" readonly placeholder="尊敬的用户您好：
    为了防止倒卖或长期占用本系统，您每天呆在本页面的时间有限，次日自动恢复。
    登录购买的账号时会弹出需要验证码才能继续登录，需要您手动点击并选择邮箱获取验证码，再来本网站的“验证码框”点击并获取
            "></textarea>
            <div class="gm">
                <!-- <a href="buy.html">购买邀请码</a> -->
            </div>
            <!-- <button class="registerBtn" @click="">支付宝续费</button> -->
            <!-- <button class="registerBtn" @click="">微信续费</button> -->
            <button class="registerBtn" @click="fk">反馈</button>

        </div>

    </section>
</body>
<script src="../public/libs/vue.min.js"></script>
<script src="../public/libs/jquery-3.4.1.min.js"></script>
<script src="../public/libs/jquery.cookie.js"></script>
<script src="../public/libs/vant.js"></script>
<script src="../public/libs/md5.js"></script>
<script src="../public/libs/app.js"></script>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            num: '',//号码
            pwd: '',//密码
            time: "",//时间
            yqm: "",
            yzm: "",
            list: [],
            price: "",
            value: "",//选择的天数下标
            yzm_string: "",//验证码文本
            MailboxName: "",//邮箱名
            Authorization: "",//邮箱授权码
            Host: "",//邮箱名
            AccountType: "",
            second: 60 * 60,//倒计时秒


        },
        mounted: function () {
            this.init();
        },
        methods: {
            init: function () {
                this.yqm = $.cookie("yqm");
                // this.yqm = "31tianTX621257d5";
                //倒计时
                $.ajax({
                    url: app.webUrl + '/bacaccount/setupAll',
                    type: 'post',
                    data: "",
                    success: function (ret) {
                        if (ret.status == 1) {
                            vm.second = ret.data.logmin*60
                            var second_cut = setInterval(() => {
                                vm.second--;
                                if (vm.second == 2) {
                                    app.text_show("在线时间上限,自动登出");
                                }
                                if (vm.second == 0) {
                                    window.location.href = "login.html"
                                    clearInterval(second_cut);
                                }
                            }, 1000);
                        } else {

                        }
                    }
                });



                $.ajax({
                    url: app.webUrl + '/account/allocation',
                    type: 'post',
                    data: { InvitationCode: this.yqm },
                    success: function (ret) {
                        if (ret.status == 1) {
                            vm.num = ret.data.Account.AccountName
                            vm.pwd = ret.data.Account.Accountpwd
                            vm.time = ret.data.sTime;
                            vm.MailboxName = ret.data.Account.MailboxName;
                            vm.Authorization = ret.data.Account.Authorization;
                            vm.Host = ret.data.Account.Host;
                            vm.AccountType = ret.data.Account.AccountType;
                            console.log(ret.data.Account.AccountType)
                            $.cookie("AccountType", ret.data.Account.AccountType);
                            console.log($.cookie("AccountType"))
                            $.cookie("Accountid", ret.data.Account.Accountid);
                        } else {

                        }
                        // console.log(num,pwd,time);
                        // vm.list = ret.data.DaysPrice;
                        // vm.price = ret.data.DaysPrice[0].price;

                    }
                });
            },
            change_price: function (value) {
                // this.price = this.list[value].price;
            },

            fk: function () {
                window.location.href = "return.html"
            },
            xf: function () {
                window.location.href = "xufei.html"
            },
            //获取验证码
            huoqu_yzm: function () {
                $.ajax({
                    url: app.webUrl + '/account/gainCode',
                    type: 'post',
                    data: {
                        MailboxName: this.MailboxName,
                        Authorization: this.Authorization,
                        Host: this.Host,
                    },
                    success: function (ret) {
                        if (ret.status == 1) {
                            var a = []
                            ret.data.forEach(item => {
                                // console.log(item);
                                a.push(item.Ttime)
                                a.push(item.txtcontent)
                                vm.yzm_string = a.join("&#10;&#10;");
                                // vm.yzm_string.concat(vm.yzm_string,item.txtcontent,"&#10;",item.Ttime,"&#10;&#10;")
                            });
                            console.log(vm.yzm_string);
                        } else {

                        }
                    }
                });
            },
        },
    });

    // 切换类来切换协议条款的选中和未选中状态
    // $(document).ready(function () {
    //     $(".agreement").click(function () {
    //         $(".agreement").toggleClass("agreementBgc");
    //     });
    // });
</script>
<!-- <script src="../public/js/register.js"></script> -->

</html>